package com.aspose.cells;

import java.util.HashMap;

class zaiu {
   private ContentTypePropertyCollection a = null;
   private int b = 0;
   private static final com.aspose.cells.b.c.a.za c = new com.aspose.cells.b.c.a.za(new String[]{"name", "index", "displayName", "internalName", "format", "default"});

   zaiu(ContentTypePropertyCollection var1) {
      this.a = var1;
   }

   void a(zcfw var1) throws Exception {
      HashMap var2 = null;
      var1.d();

      while(true) {
         while(zass.a(var1)) {
            if ("schema".equals(var1.p())) {
               String var3 = var1.a("targetNamespace");
               if ("http://schemas.microsoft.com/office/2006/metadata/properties".equals(var3)) {
                  var2 = this.b(var1);
                  continue;
               }

               if (var2.get(var3) != null) {
                  this.a(var1, var3);
                  continue;
               }
            }

            var1.a();
         }

         this.a.c = this.b;
         return;
      }
   }

   private HashMap b(zcfw var1) throws Exception {
      HashMap var2 = new HashMap();
      var1.d();

      for(; zass.a(var1); var1.a()) {
         if ("import".equals(var1.p())) {
            String var3 = var1.a("namespace");
            var2.put(var3, var3);
            this.a.b = var3;
         }
      }

      return var2;
   }

   void a(zcfw var1, ContentTypeProperty var2) throws Exception {
      if (var1.n()) {
         var1.a();
      } else {
         var1.d();

         while(zass.a(var1)) {
            if ("restriction".equals(var1.p())) {
               var2.d = var1.a("base");
               this.b(var1, var2);
            } else {
               var1.a();
            }
         }

      }
   }

   void b(zcfw var1, ContentTypeProperty var2) throws Exception {
      if (var1.n()) {
         var1.a();
      } else {
         var1.d();

         while(zass.a(var1)) {
            if ("enumeration".equals(var1.p())) {
               String var3 = var1.a("value");
               com.aspose.cells.b.a.a.ze.a(var2.f, (Object)var3);
               var1.a();
            } else {
               var1.a();
            }
         }

      }
   }

   void c(zcfw var1, ContentTypeProperty var2) throws Exception {
      if (var1.m()) {
         while(var1.l()) {
            switch(c.a(var1.p())) {
            case 0:
               var2.setName(var1.s());
               break;
            case 1:
               var2.b = zase.C(var1.s());
               if (var2.b > this.b) {
                  this.b = var2.b;
               }
               break;
            case 2:
               var2.g = var1.s();
               break;
            case 3:
               var2.h = var1.s();
               break;
            case 4:
               var2.e = var1.s();
               break;
            case 5:
               var2.i = var1.s();
               break;
            default:
               var2.a().put(var1.o(), var1.s());
            }
         }
      }

      if (var1.n()) {
         var1.a();
      } else {
         var1.d();

         while(zass.a(var1)) {
            if ("simpleType".equals(var1.p())) {
               this.a(var1, var2);
            } else if ("complexType".equals(var1.p())) {
               var2.l = var1.b();
            } else {
               var1.a();
            }
         }

      }
   }

   void a(zcfw var1, String var2) throws Exception {
      if (var1.n()) {
         var1.a();
      } else {
         var1.d();

         while(zass.a(var1)) {
            if ("element".equals(var1.p())) {
               String var3 = var1.a("name");
               int var4 = this.a.add(var3, (String)null);
               ContentTypeProperty var5 = this.a.get(var4);
               var5.c = var2;
               if (var5 != null) {
                  this.c(var1, var5);
               } else {
                  var1.a();
               }
            } else {
               var1.a();
            }
         }

      }
   }
}
